/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bs.tesoreria.dao;

import bs.facturacion.dao.*;
import bs.facturacion.modelo.ComprobanteFacturacion;
import bs.global.dao.BaseDAO;
import bs.global.modelo.ComprobantePK;
import bs.tesoreria.modelo.ComprobanteTesoreria;
import java.util.List;
import java.util.Map;
import javax.ejb.Stateless;

/**
 *
 * @author Claudio
 */
@Stateless
public class ComprobanteTesoreriaDAO extends BaseDAO {

    public ComprobanteTesoreria getComprobante(String MODCJ, String CODCJ) {
        ComprobantePK idPk = new ComprobantePK(MODCJ, CODCJ);
        return getComprobante(idPk);
    }
 
    
    public ComprobanteTesoreria getComprobante(ComprobantePK idPK){

        return em.find(ComprobanteTesoreria.class, idPK);
    }

    public void eliminar(ComprobanteTesoreria o) throws Exception{

        super.eliminar(ComprobanteTesoreria.class, o.getCodigo());
    }

    public List<ComprobanteTesoreria> getLista() {
        return getLista(ComprobanteTesoreria.class, true , -1, -1);
    }

    public List<ComprobanteTesoreria> getLista(Map<String, String> filtro) {

        String sQuery = "SELECT i FROM ComprobanteTesoreria i ";
              sQuery += generarStringFiltro(filtro,"i", true);

        return queryList(ComprobanteTesoreria.class, sQuery);
    }



    
    
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

    
}
